<template>
  <div>
    <el-row>
      <el-col>
        <div id="hollowpier" :style="{width: '100%', height: '400px'}"></div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        msg: ''
      }
    },
    mounted() {
      this.drawLine();
    },
    methods: {
      drawLine() {
        // 基于准备好的dom，初始化echarts实例
        let hollowpier = this.$echarts.init(document.getElementById('hollowpier'));
        // 绘制图表
        hollowpier.setOption(
          {
            title : {
              text: '',
              subtext: '',
              x:'center'
            },
            tooltip : {
              trigger: 'item',
              formatter: "{a} <br/>{b} : {c} ({d}%)"
            },
            legend: {
              orient: 'vertical',
              left: 'left',
              data: ['Czech Republic','Irelamd','Austria','Belgium','Lithuania']
            },
            series : [
              {
                name: '',
                type: 'pie',
                center: ['50%', '60%'],
                radius: ['40%', '70%'],
                avoidLabelOverlap: false,
                data:[
                  {value:335, name:'Czech Republic'},
                  {value:310, name:'Irelamd'},
                  {value:234, name:'Austria'},
                  {value:135, name:'Belgium'},
                  {value:1548, name:'Lithuania'}
                ],
                itemStyle: {
                  emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                  }
                }
              }
            ]
          }
        );
      }
    }
  }
</script>

<style scoped>
</style>
